#ifndef _PICTURE_H_
#define _PICTURE_H_

#include <stdio.h>
#include <dlfcn.h>  
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <linux/fb.h>
#include <fcntl.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <dirent.h>
#include <sys/mman.h>
#include "jpeglib.h"
#include <stdint.h>
#include <linux/input.h>
#include "bmp.h"
//枚举
enum enumread{bmp,jpg,buzhichi,left,right,up,down};
//图片数据结构体
struct tupian_info
{
    int wide;
    int high;
    int bpp;
    int tosize;
    char *men;    //显存入口
};
//lcd结构体
struct lcd_info
{
    int fb;
    int wide;
    int high;
    int bpp;
    int tosize;
    char *men;    //显存入口
};
//图片链表
struct filetupian
{
    char  filenametp[260];   //存储的图片文件名
    enum enumread gs;
    struct filetupian *next; //用来指向下一张图片
    struct filetupian *prev; //用来指向上一张图片
};


enum enumread tupiangeshi(const char *p);
void lcd_zhunbei(struct lcd_info *p);
void lcdsf(struct lcd_info *p);
void jpg2rgb(const char *jpgdata, size_t jpgsize,struct tupian_info *jpg);
void tupiansj(enum enumread a,struct tupian_info *p,const char *q);
void displaytu(enum enumread a,struct lcd_info *lcd,struct tupian_info *jpg);
void baiping(struct lcd_info *lcd);
enum enumread fx(void);
void jiazai(struct lcd_info *lcd,struct tupian_info *dt);


struct filetupian * csh();
struct filetupian *new_node(char filenametp[],enum enumread gs);
void endc(struct filetupian *head,struct filetupian *new);
void xh(struct filetupian *head);

int dirpdcz(const char *argv,struct filetupian *head);
void tupianqh(struct lcd_info *lcd,struct filetupian *head);
void bllb(struct filetupian *head,struct lcd_info *lcd);

#endif